package com.ianmoone.sort;

public class BubbleSort {
	public void sort(int[] a){
		for (int i = 0; i < a.length; i++) {
			for (int j =1 ; j < a.length-i; j++) {
				if (a[j-1]>a[j]) {
					int temp = a[j-1];
					a[j-1] = a[j];
					a[j] = temp;
				}
			}
		}
	}
	public static void main(String[] args){
		int[] a = {1,3,4,5,2,6,9,7,8,0};
		BubbleSort bubbleSort =  new BubbleSort();
		bubbleSort.sort(a);
		for (int i = 0; i < a.length; i++) {
			System.out.println(a[i]);
		}
	}
}
